package code.springboot.idempotent.controller;

import code.springboot.idempotent.annotation.Idempotent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class TestController {

    @GetMapping("/test/{message}")
    public String test(@PathVariable("message") String message) {
        log.info("=={}",message);
        return "test" + message;
    }

    @GetMapping("/test1/{message}")
    @Idempotent
    public String test1(@PathVariable("message") String message) {
        log.info("=={}",message);
        return "test1" + message;
    }
}
